/*   1:    */ package com.atomikos.datasource.xa.jmx;
/*   2:    */ 
/*   3:    */ import com.atomikos.datasource.xa.XATransactionalResource;
/*   4:    */ import javax.management.MBeanRegistration;
/*   5:    */ import javax.management.MBeanServer;
/*   6:    */ import javax.management.ObjectName;
/*   7:    */ 
/*   8:    */ public class JmxTransactionalResource
/*   9:    */   implements JmxTransactionalResourceMBean, MBeanRegistration
/*  10:    */ {
/*  11:    */   private XATransactionalResource resource;
/*  12:    */   private XAResourceConfig config;
/*  13:    */   private String localName;
/*  14:    */   
/*  15:    */   public JmxTransactionalResource(XATransactionalResource resource, XAResourceConfig config, String localName)
/*  16:    */   {
/*  17: 61 */     this.resource = resource;
/*  18: 62 */     this.config = config;
/*  19: 63 */     this.localName = localName;
/*  20: 64 */     setUseWeakCompare(config.usesWeakCompare());
/*  21: 65 */     setAcceptAllXAResources(config.acceptsAllXAResources());
/*  22:    */   }
/*  23:    */   
/*  24:    */   public boolean getUseWeakCompare()
/*  25:    */   {
/*  26: 74 */     return this.resource.usesWeakCompare();
/*  27:    */   }
/*  28:    */   
/*  29:    */   public void setUseWeakCompare(boolean value)
/*  30:    */   {
/*  31: 82 */     this.resource.useWeakCompare(value);
/*  32: 83 */     this.config.setUseWeakCompare(value);
/*  33:    */   }
/*  34:    */   
/*  35:    */   public ObjectName preRegister(MBeanServer arg0, ObjectName name)
/*  36:    */     throws Exception
/*  37:    */   {
/*  38: 94 */     if (name == null) {
/*  39: 95 */       name = new ObjectName("atomikos.resources", "name", this.resource.getName());
/*  40:    */     }
/*  41: 98 */     return name;
/*  42:    */   }
/*  43:    */   
/*  44:    */   public void postRegister(Boolean arg0) {}
/*  45:    */   
/*  46:    */   public void preDeregister()
/*  47:    */     throws Exception
/*  48:    */   {}
/*  49:    */   
/*  50:    */   public void postDeregister() {}
/*  51:    */   
/*  52:    */   public boolean getAcceptAllXAResources()
/*  53:    */   {
/*  54:130 */     return this.resource.acceptsAllXAResources();
/*  55:    */   }
/*  56:    */   
/*  57:    */   public void setAcceptAllXAResources(boolean val)
/*  58:    */   {
/*  59:138 */     this.resource.setAcceptAllXAResources(val);
/*  60:139 */     this.config.setAcceptAllXAResources(val);
/*  61:    */   }
/*  62:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.datasource.xa.jmx.JmxTransactionalResource
 * JD-Core Version:    0.7.0.1
 */